<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>学生信息修改</title>
		<link href="<%=basePath%>js/calendar/skins/aqua/theme.css"
			rel="stylesheet" />
		<link href="<%=basePath%>js/validate/jquery.validate.css"
			rel="stylesheet" />
		<script type="text/javascript" src="<%=basePath%>js/jquery-1.4.2.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/validate/messages_cn.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/validate/jquery.validate.js"></script>
		<script type="text/javascript" charset="UTF-8"
			src="<%=basePath%>js/validate/messages_cn.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/calendar/calendar.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/calendar/calendar-setup.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/calendar/lang/calendar-en.js"></script>

		<script type="text/javascript">
	$(function() {
		$("#studentForm").validate( {
			rules : {
				"student.stuName" : {
					required : true,
				},
				"student.birth_date" : {
					required : true
				},
				"student.create_date" : {
					required : true
				},
				"student.tel" : {
					required : true
				},
				"student.address" : {
					required : true
				}
			}
		})
	});
</script>
	</head>

	<body bgcolor="#D6E0EF">
		<div align="center">
			<form name="studentForm" id="studentForm" method="post"
				action="updateInfo!updateStudentInfo">
				<table align="center">
					<s:iterator value="student" var="student">
						<tr>
							<td>
								学生姓名：
							</td>
							<td align="left">
								<input type="text" name="student.stuName" id="student.stuName"
									value="<s:property value="stuName"/>" />
							</td>
						</tr>
						<tr>
							<td>
								出生年月：
							</td>
							<td align="left">
								<input type="text" name="student.birth_date"
									id="student.birth_date"
									value="<s:property value="birth_date"/>" readonly="readonly" />
								<img id="birthdateTime"
									src="<%=basePath%>js/calendar/skins/aqua/cal.gif"
									style="cursor: pointer;" />
							</td>
						</tr>
						<tr>
							<td>
								入学时间：
							</td>
							<td align="left">
								<input type="text" name="student.create_date"
									id="student.create_date"
									value="<s:property value="create_date"/>" readonly="readonly" />
								<img id="createdateTime"
									src="<%=basePath%>js/calendar/skins/aqua/cal.gif"
									style="cursor: pointer;" />
							</td>
						</tr>
						<tr>
							<td>
								性&nbsp;&nbsp;&nbsp;&nbsp;别：
							</td>
							<td align="left">
								<input type="radio" name="student.sex" id="student.sex"
									value="男" checked="checked" />
								男
								<input type="radio" name="student.sex" id="student.sex"
									value="女" />
								女
							</td>
						</tr>
						<tr>
							<td>
								班&nbsp;&nbsp;&nbsp;&nbsp;级：
							</td>
							<td align="left">
								<select name="student.classInfo.id" id="student.classInfo.id">
									<s:iterator value="classInfoList">
										<option value="<s:property value="id"/>">
											<s:property value="className" />
										</option>
									</s:iterator>
								</select>
							</td>
						</tr>
						<tr>
							<td>
								联系电话：
							</td>
							<td align="left">
								<input type="text" name="student.tel" id="student.tel"
									value="<s:property value="tel"/>" />
							</td>
						</tr>
						<tr>
							<td>
								家庭住址：
							</td>
							<td align="left">
								<input type="text" name="student.address"
									id="studentInfo.address" value="<s:property value="address"/>" />
							</td>
						</tr>
						<tr>
							<td>
								备&nbsp;&nbsp;&nbsp;&nbsp;注：
							</td>
							<td align="left">
								<input type="text" name="student.memo"
									id="studentInfo.memo" value="<s:property value="memo"/>" />
							</td>
						</tr>
						<tr>
							<td>
								<input type="hidden" name="student.id" id="student.id"
									value="<s:property value="id" />" />
							</td>
						</tr>
					</s:iterator>
					<tr>
						<td></td>
						<td>
							<input type="reset" name="button" id="button" value="重置" />
							<input type="submit" name="button" id="button" value="更新数据" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		<script type="text/javascript">
	Calendar.setup( {
		inputField : "student.birth_date",
		ifFormat : "%Y-%m-%d",
		showsTime : "true",
		button : "birthdateTime",
		step : 1
	});
	Calendar.setup( {
		inputField : "student.create_date",
		ifFormat : "%Y-%m-%d",
		showsTime : "true",
		button : "createdateTime",
		step : 1
	});
</script>
	</body>
</html>
